import request from '@/plugin/axios'
import { sysPath } from '@api/sys.common'

export function RoleList(params) {
    return request({
        url: sysPath + '/hx-mart/api/v1/sys/sysRole/getSysRoleByPage',
        method: 'post',
        params
    })
}

export function SaveRole(params) {
    return request({
        url: sysPath + '/hx-mart/api/v1/sys/sysRole/addRole',
        method: 'post',
        data: params
    })
}
export function DelRole(params) {
    return request({
        url: sysPath + '/hx-mart/api/v1/sys/sysRole/deleteRole',
        method: 'get',
        params
    })
}
export function GetRole(params) {
    return request({
        url: sysPath + '/hx-mart/api/v1/sys/sysRole/findRoleById',
        method: 'get',
        params
    })
}
export function UpdateRole(params) {
    return request({
        url: sysPath + '/hx-mart/api/v1/sys/sysRole/updateRole',
        method: 'post',
        data: params
    })
}
export function CheckName(params) {
    return request({
        url: sysPath + '/hx-mart/api/v1/sys/sysRole/checkRoleName',
        method: 'get',
        params
    })
}

export function AuthRole(params) {
    return request({
        url: sysPath + '/hx-mart/api/v1/sys/sysRole/authResourcesByRole',
        method: 'post',
        data: params
    })
}
export function GetAuthById(params) {
    return request({
        url: sysPath + '/hx-mart/api/v1/sys/sysRole/getResourceByRoleId',
        method: 'get',
        params
    })
}
export function GetAllUser() {
    return request({
        url: sysPath + '/hx-mart/api/v1/sys/sysUser/getAllSysUser',
        method: 'get'
    })
}
export function AuthUserr(params) {
    return request({
        url: sysPath + '/hx-mart/api/v1/sys/sysRole/authUsersByRoleId',
        method: 'post',
        data: params
    })
}
export function FindByRoleId(params) {
    return request({
        url: sysPath + '/hx-mart/api/v1/sys/sysRole/getUsersByRoleId',
        method: 'get',
        params
    })
}
export function GetTreeNode(params) {
    return request({
        url: sysPath + '/hx-mart/api/v1/sys/sysMenu/getResourceTree',
        method: 'get',
        params
    })
}